// pages/index/index.js
import {formatDate,request} from "../../utils/utils";
import api from "../../utils/api";

Page({
  data: {
		getTopPx:'',
    detailData:''
  },
  onLoad (options) {},
  onReady () {
    this.getTopPx();
    this.getDetail();
  },
	getTopPx(){
		let systemInfo = wx.getSystemInfoSync();
		let menuInfo = wx.getMenuButtonBoundingClientRect();
		let _barHeight = systemInfo.statusBarHeight;
		let _menuPad = menuInfo.top;
		let _menuHeight = menuInfo.height;
		let _topPx = _barHeight + _menuHeight + 2*( _menuPad - _barHeight);
		this.setData({ getTopPx:_topPx+'px' }) 					
	},

  async getDetail(){
    let params = {id:'P6dj0e8dr'};
    let detail = await request({url:api.getContentDetail,method:"post",data:params});
    this.setData({
      detailData:detail.data.data 
    });
  },


})